package com.zuipin.service;

import java.math.BigDecimal;
import java.util.List;

import com.zuipin.entity.IntegralRecord;
import com.zuipin.entity.MemberLevel;
import com.zuipin.enums.IntegralType;
import com.zuipin.framework.exception.CustomException;
import com.zuipin.util.Pagination;

/**
 * 积分接口
 * 
 * @ClassName: IIntegralRecordService
 * @author wuyicheng
 * @time 2017年3月27日下午3:49:12
 */
public interface IIntegralRecordService {
	public IntegralRecord findById(Long id);
	
	public List<IntegralRecord> findList(IntegralRecord integralRecord);
	
	public void insert(IntegralRecord integralRecord);
	
	public void update(IntegralRecord integralRecord);
	
	public void deleteById(Long id);
	
	public void addIntegralRecord(Long memberId, Long sysId, Long createId, Long updateId, Integer alterPoint, IntegralType integralType, String remark, String describe,
			String oddNumbers, Short isBuy) throws CustomException;
	
	/**
	 * @throws CustomException  
	 * 根据总价和会员等级计算赠送积分
	 * 
	 * @Title: getGiveIntegral 
	 * @author: wuyicheng
	 * @date: 2017年6月16日上午10:37:41 
	 * @param subtotal
	 * @param memberLevel
	 * @return
	 * @return: Integer
	 * @throws 
	 */
	public Integer getGiveIntegral(BigDecimal subtotal, MemberLevel memberLevel) throws CustomException;
	
	/**
	 * 查找所有积分记录并分页
	 * @param balanceRecord
	 * @param page
	 * @return
	 * @author zhuangjiajian
	 * @date 2017-7-31 10:36:48
	 */
	public List<IntegralRecord> findListByPage(IntegralRecord ir, Pagination page);
	
	/**
	 * 查找会员当前积分
	 * @param memberId
	 * @param sysId
	 * @return
	 * @author zhuangjiajian
	 * @date 2017-7-31 10:38:48
	 */
	public Integer getCurrentIntegral(Long memberId, Long sysId);
}
